<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>GO机网管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge">
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/nifty.min.css" rel="stylesheet">
    <link href="../css/demo/nifty-demo-icons.min.css" rel="stylesheet">
    <link href="../plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="../plugins/pace/pace.min.css" rel="stylesheet">
    <script src="../plugins/pace/pace.min.js?2016/8/5"></script>
    <link href="../css/user_defined.css" rel="stylesheet">
    <link href="../plugins/fold_menu/css/zzsc.css" rel="stylesheet">
    <style>
        .badge{
            position: relative;
        }

        .fa-close{
            position: absolute;
            top: 2px;
            right: 2px;
            cursor: pointer;
        }

        .close_color_version{
            top: 4px;
            right: 4px;
            z-index: 100;
        }
        .subNavBox{
            margin-bottom: 50px;
        }
    </style>
</head>

<!--TIPS-->
<!--You may remove all ID or Class names which contain "demo-", they are only used for demonstration. -->

<body style="display: none" id="main">
<div id="container" class="effect mainnav-lg">

    <!--NAVBAR-->
    <!--===================================================-->
    <header id="navbar">

    </header>
    <!--===================================================-->
    <!--END NAVBAR-->

    <div class="boxed">

        <!--CONTENT CONTAINER-->
        <!--===================================================-->
        <div id="content-container">

            <!--Page Title-->
            <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
            <div id="page-title">
                <h1 class="page-header text-overflow">维修项目设置</h1>
            </div>
            <!--End page title-->


            <!--Page content-->
            <!--===================================================-->
            <div id="page-content">
                <div id="page-wrapper">
                    <div class="col-sm-2">
                        <div class="subNavBox" id="l">
                            <div v-for="list in getPhoneList">
                                <div class="subNav currentDd currentDt" v-text="list.name"></div>
                                <ul class="navContent list-group">
                                    <li class="list-group-item text-center" v-for="li in list.list" v-bind:class="{'active':li.phone_id==phone_id}"><a href="#" v-text="li.name" v-bind:name="li.phone_id" v-on:click="showPhoneStatus(li.phone_id)"></a></li>
                                </ul>
                            </div>
                        </div>
                    </div>


                    <div class="col-sm-10 ds-none" id="right">
                        <table class="table table-bordered user_t_table" id="table">
                            <tbody>
                            <tr>
                                <!--<i class="fa fa-close bootbox-confirm"></i>-->
                                <td class="text-center" style="width: 120px">机型颜色</td>
                                <td>
                                    <span class="badge mar-all pad-all pointer" v-for="list in getPhoneStatus.phone_color" v-bind:name="list.id" v-on:click="alterPhone(list.id,1,list.name)">{{list.name}}<i class="fa fa-close close_color_version"></i> </span>
                                    <span class="badge mar-all pad-all pointer add_phone_type" data-toggle="modal" data-target="#myModal">+ 添加</span>
                                </td>
                            </tr>
                            <tr>
                                <td class="text-center">机型版本</td>
                                <td>
                                    <span class="badge mar-all pad-all pointer" v-for="list in getPhoneStatus.phone_version"  v-bind:name="list.id"  v-on:click="alterPhone(list.id,2,list.name)">{{list.name}}<i class="fa fa-close close_color_version"></i></span>
                                    <span class="badge mar-all pad-all pointer add_phone_type" data-toggle="modal" data-target="#add_phone_type">+ 添加</span>
                                </td>
                            </tr>
                            </tbody>
                        </table>

                        <div class="mar-ver">
                            <button class="btn btn-default"  v-on:click="checkIsFault()">+ 添加故障</button>
                        </div>


                        <table class="table table-bordered user_t_table" id="table2">
                            <thead>
                                <tr>
                                    <th style="width: 250px">故障分类</th>
                                    <th>故障问题及费用设置</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr v-for="list in getPhoneFault">
                                    <td style="position: relative"><span v-text="list.name"></span> <i class="fa fa-close fault1" style="margin-top: 3px;margin-right: 3px;" v-bind:name="list.id"></i> </td>
                                    <td>
                                        <div  v-for="li in list.fault">
                                            <span class="badge mar-all pad-all pointer" v-if="li.name" data-target="#listPhoneFault" data-toggle="modal"  v-on:click="alertPhoneFault(li.id)">
                                                <span v-text="li.name"></span><span v-text="'（'+li.price+'元）'"></span> <i class="fa fa-close fault2" style="margin-top: 3px;margin-right: 3px;" v-bind:name="li.id"></i>
                                                <span v-if="li.property.length>0"><br><br><span v-for="l in li.property" v-if="l.price!=0"><span>&nbsp;{{l.name}}&nbsp;+{{l.price}}元 &nbsp;</span>、</span></span>
                                            </span>
                                        </div>
                                        <div>
                                            <span class="badge mar-all pad-all pointer" data-target="#listPhoneFault" data-toggle="modal" v-on:click="addListPhoneFault(list.id)">+添加</span>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <!--===================================================-->
            <!--End page content-->


        </div>

        <nav id="mainnav-container">

        </nav>

    </div>


    <!-- FOOTER -->
    <!--===================================================-->
    <footer id="footer" style="padding-left:0 !important; text-align:center !important;margin-top: 50px">

        <!-- Visible when footer positions are fixed -->
        <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
        <div class="show-fixed pull-right">
            <ul class="footer-list list-inline">
                <li>
                    <p class="text-sm">SEO Proggres</p>

                    <div class="progress progress-sm progress-light-base">
                        <div style="width: 80%" class="progress-bar progress-bar-danger"></div>
                    </div>
                </li>

                <li>
                    <p class="text-sm">Online Tutorial</p>

                    <div class="progress progress-sm progress-light-base">
                        <div style="width: 80%" class="progress-bar progress-bar-primary"></div>
                    </div>
                </li>
                <li>
                    <button class="btn btn-sm btn-dark btn-active-success">Checkout</button>
                </li>
            </ul>
        </div>


        <!-- Visible when footer positions are static -->
        <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
        <div class="hide-fixed pull-right pad-rgt hide">Currently v2.4.1</div>


        <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
        <!-- Remove the class name "show-fixed" and "hide-fixed" to make the content always appears. -->
        <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->

        <p class="pad-lft">Copyright &#0169; 2014-2016  YIHOU  Inc.  All  Rights  Reserved</p>


    </footer>
    <!--===================================================-->
    <!-- END FOOTER -->


    <!-- SCROLL TOP BUTTON -->
    <!--===================================================-->
    <button id="scroll-top" class="btn"><i class="fa fa-chevron-up"></i></button>
    <!--===================================================-->


    <!-- 版本属性（Modal） -->
    <div class="modal fade" id="add_phone_type" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title" id="">添加机型版本</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal">
                        <div class="form-group">
                            <label class="col-sm-3 control-label" for="color">版本名称</label>
                            <div class="col-sm-6">
                                <input type="text" placeholder="" class="form-control input-sm" id="versionName">
                            </div>
                        </div>

                        <div class="login-msg error" id="error2">
                            <i class="fa fa-warning"></i>
                            <p class="error"></p>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" id="add_versionName">确定添加</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->


    <!-- 颜色属性（Modal） -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title" id="myModalLabel">添加颜色属性</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal">
                        <div class="form-group">
                            <label class="col-sm-3 control-label" for="color">颜色名称</label>
                            <div class="col-sm-6">
                                <input type="text" placeholder="" class="form-control input-sm" id="color">
                            </div>
                        </div>

                        <div class="login-msg error" id="error1">
                            <i class="fa fa-warning"></i>
                            <p class="error"></p>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" id="addColor">确定添加</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->


    <!-- 添加主故障（Modal） -->
    <div class="modal fade" id="mainPhoneFault" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title">添加手机故障</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal">
                        <div class="form-group">
                            <label class="col-sm-3 control-label" for="color">故障名称</label>
                            <div class="col-sm-6">
                                <input type="text" placeholder="" class="form-control input-sm" id="PhoneFaultName">
                            </div>
                        </div>

                        <div class="login-msg error" id="error3">
                            <i class="fa fa-warning"></i>
                            <p class="error"></p>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" id="add_mainPhoneFault">确定添加</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->

    <!-- 添加次故障（Modal） -->
    <div class="modal fade" id="listPhoneFault" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title">添加手机故障</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal">
                        <div class="form-group">
                            <label class="col-sm-3 control-label" for="color">故障名称</label>
                            <div class="col-sm-6">
                                <input type="text" placeholder="" class="form-control input-sm" id="PhoneFaultName2">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label" for="color">维修价格</label>
                            <div class="col-sm-6">
                                <input type="text" placeholder="" class="form-control input-sm" id="PhoneFaultPrice2">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label" for="color">维修成本</label>
                            <div class="col-sm-6">
                                <input type="text" placeholder="" class="form-control input-sm" id="PhoneFaultCost2">
                            </div>
                        </div>


                        <p class="help-block text-warning">*以下机型版本或颜色如需加价请在相应输入框输入加价金额，如该版本或颜色无法提供维修，请输入负数代表无法维修。</p>

                        <div class="pad-all bord-all mar-btm" id="dis1">
                            <h4 class="mar-no" style="margin-bottom: 10px">机型颜色（维修价格/维修成本）</h4>
                            <div class="form-group mar-top" v-for="list in getPhoneStatus.phone_color">
                                <label class="col-sm-3 control-label" for="color" v-text="list.name"></label>
                                <div class="col-sm-3">
                                    <input type="text" placeholder="不填价格代表可维修不加价" class="form-control input-sm phone_color" v-bind:name="list.id">
                                </div>
                                <div class="col-sm-3">
                                    <input type="text" placeholder="不填则不加维修成本" class="form-control input-sm phone_cost" v-bind:name="list.id">
                                </div>
                            </div>
                        </div>

                        <div class="pad-all bord-all mar-btm">
                            <h4 class="mar-no" style="margin-bottom: 10px">机型版本（维修价格/维修成本）</h4>
                            <div class="form-group mar-top" v-for="list in getPhoneStatus.phone_version">
                                <label class="col-sm-3 control-label" for="color" v-text="list.name"></label>
                                <div class="col-sm-3">
                                    <input type="text" placeholder="不填价格代表可维修不加价" class="form-control input-sm phone_color" v-bind:name="list.id">
                                </div>
                                <div class="col-sm-3">
                                    <input type="text" placeholder="不填则不加维修成本" class="form-control input-sm phone_cost" v-bind:name="list.id">
                                </div>
                            </div>
                        </div>


                        <div class="login-msg error" id="error4">
                            <i class="fa fa-warning"></i>
                            <p class="error"></p>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" id="add_mainPhoneFault2">确定添加</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->

</div>
<script src="../js/jquery-2.2.1.min.js"></script>
<script src="../js/left_menu.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../plugins/fast-click/fastclick.min.js"></script>
<script src="../js/nifty.min.js?2016/8/5"></script>
<script src="../plugins/sparkline/jquery.sparkline.min.js"></script>
<script src="../plugins/vue/vue.min.js"></script>
<script src="../js/base.js"></script>
<script>
    var phone_id = ''; //选入的手机id
    var status_id = '';

    var fault_id = '';//手机故障主id
    var alert_fault_id; //修改手机故障id
    var phone_status;//手机版本 颜色数组
    var fault_info_json;

    var vue = new Vue({
        el:'#main',
        data:{
            getPhoneList:'',
            getPhoneStatus:'',
            getPhoneFault:'',
            phone_id:''
        },
        methods:{
            'showPhoneList':function(){
                var that = this;

                $.post('../index/admin.php?m=Admin&c=Phone&a=getPhoneList',{},function(res){
                    if(res.code==200){
                        that.getPhoneList = res.data;
                    }

                },'json');
            },
            //判断是否可以添加主故障
            'checkIsFault':function(){
                var phone_statu = JSON.parse(phone_status);
                if(phone_statu.phone_color && phone_statu.phone_version){
                    $('#mainPhoneFault').modal('show');
                }else {
                    alert('请先添加机型颜色和机型版本');
                }

            },
            'showPhoneStatus':function(index){
                var that = this;
                var data = {};
                phone_id = index;
                data.phone_id = index;
                that.phone_id = index;
                loading.show();
                $.post('../index/admin.php?m=Admin&c=Phone&a=getPhoneProperty',data,function(res){
                    if(res.code==200){
                        phone_status = JSON.stringify(res.data);
                        that.getPhoneStatus = res.data;
                    }else if(res.code==201){
                        phone_status = '';
                        that.getPhoneStatus = '';
                    }
                    loading.close();
                    $('#right').show();
                },'json');
                this.showFaultList();
            },
            //显示维修列表
            'showFaultList':function(){
                var that = this;
                var data = {};
                data.phone_id = phone_id;
                $.post('../index/admin.php?m=Admin&c=Phone&a=getPhoneFaultInfo',data,function(res){
                    if(res.code==200){
                        fault_info_json = res.data;
                        that.getPhoneFault = res.data;
                    }else if(res.code==201){
                        that.getPhoneFault = '';
                    }
                },'json')
            },
            'alterPhone':function(id,type,name){
                status_id = id;
                if(type==2){
                    $('#versionName').val(name);
                    $('#add_phone_type').modal('show');
                }else if(type==1){
                    $('#color').val(name);
                    $('#myModal').modal('show');
                }
            },
            //添加次故障
            'addListPhoneFault':function(id){
//                alert(id);
                alert_fault_id='';
                fault_id = id;
            },
            //修改次故障
            'alertPhoneFault':function(id){
                alert_fault_id = id;
                var json = initFaultInfo();
                var demo = $('#listPhoneFault');

                $('#PhoneFaultName2').val(json.name);
                $('#PhoneFaultPrice2').val(json.price);
                $('#PhoneFaultCost2').val(json.cost);
                for(var i in json.property){
                    if(json.property[i].status==0){
                        demo.find('input.phone_color[name='+json.property[i].property_id+']').val(-1);
                    }else{
                        demo.find('input.phone_color[name='+json.property[i].property_id+']').val(json.property[i].price);

                    }
                    demo.find('input.phone_cost[name='+json.property[i].property_id+']').val(json.property[i].cost);
                }
            }
        },
        ready:function(){
            this.showPhoneList();
        }
    });


    function initFaultInfo(){
        for(var i in fault_info_json){
            for(var k in fault_info_json[i].fault){
                if(fault_info_json[i].fault[k].id == alert_fault_id){
                    return fault_info_json[i].fault[k];
                }
            }
        }
    }

    $(function(){
        $("#l").on('click','.subNav',function(){
            $(this).toggleClass("currentDd").siblings(".subNav").removeClass("currentDd");
            $(this).toggleClass("currentDt").siblings(".subNav").removeClass("currentDt");

            // 修改数字控制速度， slideUp(500)控制卷起速度
            $(this).next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
        })
    });


    //添加颜色
    $('#addColor').on('click',function(){
        var data = {};
        data.phone_id = phone_id;
        data.name = $('#color').val();
        if(status_id) data.id = status_id;
        if(data.name.length==0){
            showError($('#error1'),'请输入手机颜色');
            return false;
        }


        data.type = 'phone_color';
        $.post('../index/admin.php?m=Admin&c=Phone&a=addPhoneProperty&type=phone_color',data,function(res){
            if(res.code==200){
                vue.showPhoneStatus(phone_id);
                $('#color').val('');
                $('#myModal').modal('hide');
            }else if(res.code==201){

            }

        },'json')
    });


    //添加版本
    $('#add_versionName').on('click',function(){
        var data = {};
        data.phone_id = phone_id;
        data.name = $('#versionName').val();
        if(status_id) data.id = status_id;
        data.type = 'phone_version';
        if(data.name.length==0){
            showError($('#error1'),'请输入手机版本');
            return false;
        }
        $.post('../index/admin.php?m=Admin&c=Phone&a=addPhoneProperty&type=phone_version',data,function(res){
            if(res.code==200){
                vue.showPhoneStatus(phone_id);
                $('#versionName').val('');
                $('#add_phone_type').modal('hide');
            }else if(res.code==201){

            }
        },'json')
    });


    //添加手机故障
    $('#add_mainPhoneFault').on('click',function(){
        var data = {};
        data.phone_id = phone_id;
        data.name = $('#PhoneFaultName').val();
        data.price = 0;
        if(data.name.length==0){
            showError($('#error3'),'请输入手机故障');
            return false;
        }
        $.post('../index/admin.php?m=Admin&c=Phone&a=addPhoneFault',data,function(res){
            if(res.code==200){
                $('#PhoneFaultName').val('');
                $('#mainPhoneFault').modal('hide');
                vue.showFaultList(phone_id);
            }else if(res.code==201){

            }
        },'json')
    });

    //添加手机次故障
    $('#add_mainPhoneFault2').on('click',function(){
        var data = {};
        if(alert_fault_id){
            data.id = alert_fault_id;
            data.phone_id = phone_id;
        }else{
            data.phone_id = phone_id;
        }
        if(data.phone_id)
        data.kid = fault_id;
        data.name = $('#PhoneFaultName2').val();
        data.price = $('#PhoneFaultPrice2').val();
        data.cost = $('#PhoneFaultCost2').val();
        if(data.name.length==0){
            showError($('#error4'),'请输入手机故障');
            return false;
        }else if(data.price<1){
            showError($('#error4'),'请输入维修价格');
            return false;
        }
        $.post('../index/admin.php?m=Admin&c=Phone&a=addPhoneFault',data,function(res){
            if(res.code==200){
                machine_Fault(res.data.id);
                $('#PhoneFaultName2').val('');
                $('#PhoneFaultPrice2').val('');
                $('#PhoneFaultCost2').val('');
                $('#listPhoneFault').modal('hide');
            }else if(res.code==201){

            }
        },'json')
    });


    function machine_Fault(fault_id){
        var data = {};
        var json_arr = [];
        var i = 0;
        $('input.phone_color').each(function(){
            var json = {};
            var that = $('input.phone_color').eq(i);
            var costDemo = $('input.phone_cost').eq(i);
            json.property_id = that.attr('name');
            json.price = that.val();
            json.cost = costDemo.val();
            if(!json.price)json.price=0;
            if(json.price<0){
                json.status = 0;
                json.price = 0;
            }else{
                json.status = 1;
            }
            json_arr.push(json);
            i++;
        });
        if(alert_fault_id){
            data.id = alert_fault_id;
            data.fault_id = fault_id;
        }else{
            data.id = fault_id;
        }
        data.json = JSON.stringify(json_arr);
        $.post('../index/admin.php?m=Admin&c=Phone&a=addPhoneFaultInfo',data,function(res){
            if(res.code==200){
                $('input.phone_color').val('');
                $('input.phone_cost').val('');
                vue.showFaultList(phone_id);
            }else if(res.code==201){

            }
        },'json')
    }

    function showError(demo,text){
        demo.show().find('p').text(text);
    }

    $('#right').on('click','.close_color_version', function(event){
        event.stopPropagation();
        var id = $(this).parent().attr('name');
        setTimeout(function(){
            $('#myModal').modal('hide');
            $('#add_phone_type').modal('hide');
        },1);
        bootbox.confirm("是否删除?", function(result) {
            if (result) {
                deleteStatus(id);
            }else{

            }
        });
    });


    //删除手机属性
    function deleteStatus(id){
        var data = {};
        data.property_id = id;
        $.post('../index/admin.php?m=Admin&c=Phone&a=delPhoneProperty',data,function(res){
            if(res.code==200){
                vue.showPhoneStatus(phone_id);
                $('#mainPhoneFault').modal('hide');
            }else if(res.code==201){

            }
        },'json')
    }

    //删除手机故障
    $('#table2').on('click','.fault2',function(event){
        event.stopPropagation();
        var id = $(this).attr('name');
        bootbox.confirm("是否删除?", function(result) {
            if (result) {
                var data = {};
                data.id = id;
                $.post('../index/admin.php?m=Admin&c=Phone&a=delPhoneFaultInfo',data,function(res){
                    if(res.code==200){
                        vue.showFaultList();
                    }else if(res.code==201){

                    }
                },'json')
            }else{

            }
        });
    });


    //删除手机主故障
    $('#table2').on('click','.fault1',function(event){
        event.stopPropagation();
        var id = $(this).attr('name');
        bootbox.confirm("是否删除?", function(result) {
            if (result) {
                var data = {};
                data.id = id;
                $.post('../index/admin.php?m=Admin&c=Phone&a=delPhoneFault',data,function(res){
                    if(res.code==200){
                        vue.showFaultList();
                    }else if(res.code==201){

                    }
                },'json')
            }else{

            }
        });
    });


    $('#myModal,#add_phone_type').on('hidden.bs.modal', function (e) {
       clear_input();
    });



    function clear_input(){
        status_id = '';
        $('#PhoneFaultName').val('');
        $('#color').val('');
    }
</script>
</body>
</html>
